Skip to content

SONARJAVA-6624 Fix S5738: Replace deprecated @EnableRuleMigrationSupport with JUnit 5 native APIs#5795

Closed
daniel-teuchert-sonarsource wants to merge 2 commits into
masterfrom
fix/sonarqube-s5738-remove-deprecated-enable-rule-migration-support
Closed

SONARJAVA-6624 Fix S5738: Replace deprecated @EnableRuleMigrationSupport with JUnit 5 native APIs#5795
daniel-teuchert-sonarsource wants to merge 2 commits into
masterfrom
fix/sonarqube-s5738-remove-deprecated-enable-rule-migration-support

Conversation

@daniel-teuchert-sonarsource

Copy link
Copy Markdown
Contributor

Summary

  • Removes @EnableRuleMigrationSupport (java:S5738 — deprecated class marked for removal) from 12 test files
  • Migrates JUnit 4 @Rule TemporaryFolder to JUnit 5 @TempDir Path across all affected tests
  • Updates InputFileUtils.addFile() and ExternalReportTestUtils.generateReport() helper signatures from TemporaryFolder to Path
  • Removes unused @Rule LogTester from two doc example tests (was only present for debug viewing, never asserted on)

Test plan

  • All 12 previously-flagged test files compile without @EnableRuleMigrationSupport
  • CI passes (SonarQube scan on next should no longer report S5738 issues in new code)

🤖 Generated with Claude Code

…5 native APIs

Migrate 12 test files from JUnit 4 @Rule/TemporaryFolder to JUnit 5 @tempdir Path,
and drop @EnableRuleMigrationSupport (marked for removal). Helper methods in
InputFileUtils and ExternalReportTestUtils updated to accept Path instead of
TemporaryFolder. LogTester @rule removed from doc example tests where it was
unused in assertions.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Fix S5738: Replace deprecated @EnableRuleMigrationSupport with JUnit 5 native APIs SONARJAVA-6624 Fix S5738: Replace deprecated @EnableRuleMigrationSupport with JUnit 5 native APIs Jul 15, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

SONARJAVA-6624

Removing TemporaryFolder/EnableRuleMigrationSupport imports from JavaSensorTest.java
reduced the type error count by 6 (those were unresolvable types). Update the
hardcoded expected value from 205 to 199.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@sonarqube-next

Copy link
Copy Markdown

@gitar-bot

gitar-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Replaces deprecated @EnableRuleMigrationSupport with JUnit 5 native APIs and migrates @Rule TemporaryFolder to @TempDir Path. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@daniel-teuchert-sonarsource daniel-teuchert-sonarsource deleted the fix/sonarqube-s5738-remove-deprecated-enable-rule-migration-support branch July 16, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant